In this guide you will build a simple login form — aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/danielitoCode/compose_svelted/llms.txt
Use this file to discover all available pages before exploring further.
Column layout containing a headline, a body label, an email TextField, a password TextField, and a Button that handles the submit action. Along the way you will see how Modifier chains work, how Text text-style tokens map to Material 3 typography, and how every part of the UI composes from the same small set of primitives imported from a single package.
Before continuing, make sure you have completed the Installation steps and that your app is wrapped with ComposeTheme and AppRoot.
Create the app shell
Every Compose Svelted screen lives inside All imports come from the single
ComposeTheme and AppRoot. If you have already added these to your root App.svelte, create a new component file for the login screen — for example, LoginScreen.svelte. Start with the script block and import the components you need:@danielito1996/compose-svelted package entry point. Svelte 5 runes ($state) are used for local reactive state — no stores or external state management required for simple screens.Add a Column layout with padding
Column is a vertical flex container, equivalent to Jetpack Compose’s Column. Apply sizing and spacing through the modifier prop using the immutable Modifier chain.Modifier.fillMaxSize() expands the column to fill its parent (the AppRoot viewport). .padding(32) adds 32 px of padding on all sides. The modifier chain is immutable — each call returns a new ModifierImpl instance — so you can safely compose and reuse modifier values.To add vertical spacing between children, use Arrangement.spacedBy(n):Add Text components with typography tokens
Text renders a <p> element styled by a Material 3 typography token passed to the textStyle prop. The available tokens map directly to the Material 3 type scale:TextStyleToken values available for textStyle is:color prop, which accepts any ColorToken (e.g., "onSurface", "primary") or a raw CSS color string.Add TextField components for email and password
TextField is a filled Material 3 text field with a floating label. Bind it to your state with value and onValueChange:Modifier.fillMaxWidth() makes each field stretch to the full width of its parent Column. If you prefer the outlined variant, swap TextField for OutlinedTextField — it accepts the same props.Add a Button with onClick
Button renders a filled Material 3 button. Pass a callback to onClick and place the label text as a slot child:modifier prop for sizing and spacing. The color and onColor props accept ColorToken values to customize the button’s background and label color against the active theme.Complete example
Here is the fullLoginScreen.svelte component assembled from the steps above, ready to drop into any Compose Svelted project:
App.svelte that renders it inside the required providers:
Next steps
Modifier API
Learn every method in the Modifier chain: padding, size, clipping, scroll, weight, and more.
Column, Row & Box
Explore the three layout primitives and their alignment and arrangement options.
Buttons
Discover the full button family: Button, TextButton, OutlinedButton, IconButton, and more.