M3E component library

Piko ships a Material 3 Expressive (M3E) component library as 46 PKC components under components/m3e/. Register the whole set with components.M3E().

Registration

import (
    "piko.sh/piko"
    "piko.sh/piko/components"
)

ssr := piko.New(
    piko.WithComponents(components.M3E()...),
)

Once registered, the components are available as custom elements in any PK template. Tree-shaking removes unused components from the shipped bundle.

Component list

Components grouped by role. Each tag appears in PK templates exactly as written. See the individual .pkc files for prop and slot details.

Layout and structure

TagRole
m3e-cardSurface container.
m3e-dividerVisual separator.
m3e-elevationApplied elevation surface.
m3e-listList container.
m3e-list-itemItem inside a list.
m3e-toolbarToolbar surface.
m3e-top-app-barTop application bar.
m3e-bottom-app-barBottom application bar.
m3e-side-sheetSide-mounted sheet.
m3e-bottom-sheetBottom-mounted sheet.
TagRole
m3e-navigation-barBottom navigation bar.
m3e-navigation-drawerSide navigation drawer.
m3e-navigation-railSide navigation rail.
m3e-tabsTab bar.
m3e-tabIndividual tab.
m3e-menuMenu container.
m3e-menu-itemMenu item.
m3e-searchSearch bar.

Buttons

TagRole
m3e-buttonStandard button.
m3e-button-groupMulti-button row.
m3e-icon-buttonIcon-only button.
m3e-fabFloating action button.
m3e-extended-fabExtended FAB (icon + label).
m3e-fab-menuFAB that expands into a menu.
m3e-split-buttonSplit-action button.
m3e-segmented-buttonSegmented control.

Inputs

TagRole
m3e-text-fieldText input.
m3e-checkboxCheckbox.
m3e-radioSingle radio button.
m3e-radio-groupGroup of radios.
m3e-switchToggle switch.
m3e-sliderRange slider.
m3e-selectSelect/dropdown.
m3e-date-pickerDate picker.
m3e-time-pickerTime picker.

Feedback

TagRole
m3e-snackbarTransient message.
m3e-dialogModal window.
m3e-tooltipHover tooltip.
m3e-progressProgress indicator.
m3e-loading-indicatorLoading spinner.
m3e-rippleRipple overlay for interactive surfaces.

Content

TagRole
m3e-carouselHorizontal carousel.
m3e-badgeCount or status badge.
m3e-chipSingle chip (filter, input, suggestion).
m3e-chip-setCollection of chips.
m3e-iconInline icon.

Props and slots

Each component declares its reactive state and slots in its .pkc file. The general conventions:

  • A <script lang="ts"> block declares state as a const state = { ... } object with as Type annotations. The compiler emits a static propTypes getter from the annotations so the runtime can coerce attribute strings back to typed values when external code sets attributes on the host element. Primitive fields (string, number, boolean) auto-reflect to and from HTML attributes; non-primitive fields stay internal.
  • Slots use the standard HTML <slot> (default) or <slot name="..."> (named) - these are real Web Components.
  • Callers project content into named slots with the standard HTML slot="name" attribute on the content element.

Open the specific .pkc file for the state table. Browse the source at components/m3e/.

Theming

M3E components read palette and typography values from CSS custom properties on the root element. Project-level CSS that defines the same custom properties overrides the defaults.

Scenarios using M3E

See also