Metadata-Version: 2.4
Name: fhswiftui
Version: 0.0.2
Summary: SwiftUI inspired wrapper for FastHTML
Home-page: https://github.com/thechandru/fhswiftui
Author: Chandru Subramanian
Author-email: pypi@chandru.blog
License: Apache Software License 2.0
Keywords: fasthtml basecoat swiftui python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: python-fasthtml
Provides-Extra: dev
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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
```
