Skip to content

Components

Components are the building blocks a page renders. Each is a PHP builder that serializes to a typed node (type plus props) the renderer maps to a React component. They compose into a tree: container components take a ->schema([...]) of children, and children can be containers themselves.

Card::make('Team settings', 'Manage how your team appears.')->schema([
Stack::make()->gap(Gap::Small)->schema([
Heading::make('Members', 2),
Text::make('Three people have access to this team.'),
Badge::make('3 active'),
]),
Button::make('Invite member'),
]);

Every example on these pages has four tabs: the PHP that builds it, the live Preview, the serialized Tree the renderer receives, and the theme Style tokens it uses.

ComponentPurposePage
Stack, Grid, CardArrange children — vertical/horizontal, columns, bordered panelsLayout
Section, CollapsibleTitled and untitled disclosures that fold open and closedSection & Collapsible
FloatingPanelPin children to a viewport cornerFloating panel
Heading, Text, Badge, Icon, RawBlockDisplay primitives — headings, prose, pills, sprite icons, raw HTMLText & badges
Button, Link, SegmentedControlButtons, navigational links, and standalone segmented controlsButtons & links
Tabs, TabA tab strip with URL-synced, lazily rendered panelsTabs
ModalA dialog opened and closed by action effectsModals
TooltipAn ⓘ info popover you can place anywhereTooltip
ChartLine, bar, area, and pie chartsCharts
NotificationsA bell listing a user’s database notifications, realtime + pollingNotifications

Components are the same building blocks used across Lattice. You place them in a page’s schema, inside a form alongside fields, and in a table’s empty and header slots. Containers nest freely, so a Card can hold a Stack of Text and Buttons, and a Section can hold a Grid of anything.

A Fragment renders a piece of UI resolved on its own, so it can be reloaded independently of the page — see Fragments.

Register your own components to extend the renderer with your own typed nodes and React views. See Extending → Custom fields, Registry and types, and Component packages.