Sierra guide / Around Sierra
Components with @frontierjs/ui
@frontierjs/ui is Mesa components over the css vocabulary: the keyboard, focus, ARIA and state that a stylesheet cannot give you. A component takes a tone and a treatment as props, so there is no color to carry, and <Form> reads a resource and writes its own fields.
<script>
import Alert from '@frontierjs/ui/components/feedback/Alert.mesa'
import Form from '@frontierjs/ui/components/forms/Form.mesa'
import { leads } from '@/resources/Lead.mesa'
</script>
<Alert tone="warning" title="Heads up">Your trial ends Friday.</Alert>
<Form resource={leads} />
What else it can do
- The kit covers forms, display, layout, overlay and feedback, from
InputandSelecttoModal,Drawer,Tabs,TableandToaster <Form resource={leads} />generates a control for every writable column and puts each server error under its fieldonlyandexceptnarrow the generated fields, and writing children means you write the form- A foreign key becomes a picker whose rows come from the relation
autosavemakes a form save once the typing stopsButtontakestoneandtreatmentas separate propsdata-confirm="Delete this order?"on any element asks first, once<ConfirmProvider />is mounted- Every component merges a
classyou pass and forwards attributes it does not declare, so most changes need no new component - Write your own
.mesacomponent when the kit has nothing that draws the thing, and style it with the same tones and treatments
In depth: ui README § What's in the box, § Forms know what they are editing