# fhswiftui


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

`fhswiftui` is a SwiftUI inspired wrapper for FastHTML and tailwind.
`fhswiftui` is built on top of FastHTML and tailwind and will work with
all FT components. Tailwind classes and FastHTML features work
seamlessly.

FastHTML enables composing HTML apps by nested Python objects and
tailwind is a CSS framework that provides standard CSS components. Since
tailwind relies heavily on CSS classes to define components as well as
include style information, this can quickly become complex and difficult
to read.

For example, let’s consider a simple example of a turn in a chat which
displays a user’s message with a timestamp. In FastHTML + tailwind, this
would look like something:


    Section(
        Div(
            Span('04:30:56', cls='text-xs text-muted-foreground'),
            Div('What is the meaning of life?', cls='flex w-max max-w-[75%] flex-col gap-2 rounded-lg px-3 py-2 text-sm border-l-4 border-primary italic'),
            cls='flex gap-2 items-center'
        ),
        cls='space-y-6'
    )

`fhswiftui` provides layout and UI components. It also provides property
setters that enable specific styling. The same example above using
`fhswiftui`:

    HStack(alignment="center")(
        Text('04:30:56').fg("muted-foreground").font(size="xs"),
        VDivider(border_color),
        Div(t.m).padding(left=3, right=3, top=2, bottom=2).font(size="sm")
    )

`fhswiftui` is built on top of FastHTML and tailwind and will work with
all FT components. Tailwind classes and FastHTML features work
seamlessly.

### Installation

Install latest from [pypi](https://pypi.org/project/fhswiftui/)

``` sh
$ pip install fhswiftui
```
