Skip to content

Build an interface

Start with the action a person needs to complete. Each workflow below links to a working example and the component reference. Use the Preview, Code, API and Source tabs to try an interaction and take the implementation into your application.

Collect information in a form

For an application form, give each input a visible label with Field. Place instructions beside the decision they explain. On submission, keep entered values and link each error in the summary to its field. Use SwissAddressForm for a complete postal address, or its exported SwissAddressFields for part of a larger form. Let MultilingualField collect several translations of the same content. The public service block demonstrates draft recovery, attachments and server validation.

Compare table rows and amounts

Use Table for a straightforward comparison. Choose DataTable when someone will sort, group or inspect records. Identify the currency in the column heading and supply amounts as numbers so sorting still works. Short text links and document numbers such as 2026-0141 stay together automatically. If a custom link contains an icon or nested markup, set nowrap: true on its column. Use nowrap: false to allow wrapping. Reserve CurrencyCHF for amounts that need their own currency label. In the invoice review project, try a revision and inspect the result.

Open a window or a menu

Place a single frequent action in a Button. Group additional actions on the same record in a DropdownMenu whose name identifies that record. Use Dialog when an action needs inputs, or AlertDialog before an irreversible change. Check the initial focus, Escape and focus after the window closes. If the action removes the trigger, choose a surviving row or heading as the next focus target.

Pick a date and offer appointments

For a spare field in a form use DatePicker. Keep Calendar visible when comparing several days is the task. Store the selected civil date as an ISO date string. Supply a workplace canton and booking constraints where they apply. The Swiss guide describes public holidays and regional observance.

Lay out a page on a grid

Choose the heading, reading column and primary action before deciding how many columns to use. Align them with Grid; use Stack for the smaller groups within each region. Typography supplies the display scale and reading measure. Try a long label, keyboard navigation and 200% text zoom in the narrowest column. See the design principles for paired layout examples.

Keep navigation consistent across pages

Place the site header above the application's own index or toolbar. Pass the home link and logo to NavigationMenu.brand, route links to sections, and repository, release and appearance controls to actions. Use NavigationBrand for the logo and name, NavigationAction for a utility link and ThemeToggle for a persistent device, light or dark preference. For a server-rendered site, include themeInitializationScript in the document head to restore the saved choice before paint. NavigationMenu example and API