PetalComponents.Tabs (petal_components v4.6.0)

Copy Markdown View Source

Summary

Functions

tab(assigns)

Attributes

  • class (:any) - CSS class. Defaults to nil.
  • label (:string) - labels your tab. Defaults to nil.
  • link_type (:string) - Defaults to "a". Must be one of "a", "live_patch", or "live_redirect".
  • to (:string) - link path. Defaults to nil.
  • number (:integer) - indicates a number next to your tab. Defaults to nil.
  • underline (:boolean) - underlines your tab (legacy for variant="underline"). Defaults to false.
  • variant (:string) - match the parent tabs variant. Overrides the legacy underline flag. Defaults to nil. Must be one of nil, "pill", "underline", or "segmented".
  • is_active (:boolean) - indicates the current tab. Defaults to false.
  • disabled (:boolean) - disables your tab. Defaults to false.
  • on_change (Phoenix.LiveView.JS) - JS commands to run when this tab is selected. Defaults to %Phoenix.LiveView.JS{ops: []}.
  • Global attributes are accepted. Supports all globals plus: ["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type"].

Slots

  • inner_block

tabs(assigns)

Attributes

  • underline (:boolean) - underlines your tabs (legacy for variant="underline"). Defaults to false.
  • variant (:string) - tab style: pill (default), underline, or segmented - active tab is a raised white pill on a muted track. Overrides the legacy underline flag. Defaults to nil. Must be one of nil, "pill", "underline", or "segmented".
  • class (:any) - CSS class. Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block