BottomNav
Mobile-first bottom navigation bar with item group selection, grow mode and layout system integration.
Aperçu
Rendu de l’aperçu en cours…
verticalRendu de l’aperçu en cours…
horizontalRendu de l’aperçu en cours…
shiftStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-bottom-nav> — root bar ①, selected button ② and unselected buttons ③. The bar is a <nav> with aria-label="Bottom navigation".- 1.origam-bottom-nav
- Root
- 2.origam-bottom-nav__content
- Flex row containing all navigation buttons. justify-content: center by default.
- 3.origam-bottom-nav__btn
- Each OrigamBtn item. Gets --selected modifier when active in the group.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- growbooleanfalse
- When true, navigation buttons flex-grow to fill the full bar width equally.
- Layout mode of the child buttons: "vertical" stacks icon above label, "horizontal" places them side-by-side, "shift" slides label down when inactive.
- itemsArray<IBtnProps>[]
- Navigation items rendered as Btn-shaped descriptors. Each item can carry icon, text, to/href and active state.
- Horizontal placement when the bar does not span full width: "start", "center" or "end".
- tagstring'nav'
- HTML element rendered at the root. Defaults to <nav> for correct landmark semantics.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Intent or custom color propagated to all child Btn elements via OrigamDefaultsProvider.
- bgColor
- Background color of the bar itself.
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border (typically a top border to separate from page content).
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- elevationTElevation
- Box-shadow elevation token.
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- heightnumber | string
- Override the bar height. Defaults to 48 px (density-adjusted).
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Propagated to all child Btn elements. Affects bar height via density offset.
- Border-radius token or boolean.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- namestring'bottom-navigation'
- Layout system identifier. Sibling regions use this name to offset their bottom edge by the bar height.
- orderstring | number
- Layout order relative to other layout items (DrawerGroup, AppBar, etc.).
- absolutebooleanfalse
- Positions the bar absolutely rather than as a layout item.
- locationTDirectionBoth
- disabledboolean
- modelValueanytrue
- Controls bar visibility. Drives the slide-in/out transition. Supports v-model.
- multipleboolean
- mandatoryboolean
- maxnumber
- selectedClassstring'origam-bottom-nav__btn--selected'
- CSS class added to the currently-selected button in the group.
- hoverboolean | IStateEffectConfig
- hoverClassstring
- activeboolean | IStateEffectConfig
- activeClassstring
- Slide-in/out transition component. Defaults to OrigamTranslateBottom (slides up from the bottom). Pass a component descriptor to override.
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Full override of the bar content. When present, items prop is ignored.
- #item
- Override for every navigation item. Receives the item descriptor and its index.
- #item.{index}
- Override for a specific item by index (e.g. #item.0 for the first item).
API
Emits
Événements émis par ce composant.
- @update:modelValueany
- Fired when bar visibility changes. Supports v-model.
- @update:hoverboolean
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to child components.
- Ref<string>
- Reactive CSS string generated by useStyle from the computed navStyles.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet. Called automatically on mount.
- () => void
- Removes the injected style sheet. Called automatically on unmount.
- Ref<boolean>
- True once the style sheet has been injected.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- Bar background color.
- Default foreground color.
- Bar height (density-adjusted at render time).
- Max-width constraint for centered/partial-width bars.
- Default box-shadow. Overridden to elevated variant shadow (upward).
- Density offset applied to height and padding. compact: 8px, comfortable: -8px.
- Top border width. Typically set to separate the bar from page content.
- Transition applied to the bar for smooth show/hide animations.
- Flex justify-content for the content row.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | Action |
|---|---|
| Tab | Moves focus between navigation buttons. |
| Enter / Space | Activates the focused navigation button. |
Notes
- The root <nav> element has aria-label="Bottom navigation" hardcoded in the template for clear landmark identification.
- The selectedClass prop ("origam-bottom-nav__btn--selected") is applied by the group system but does not automatically set aria-current or aria-selected — consumers should bind aria-current="page" on the active item.
- The v-contrast directive is applied to ensure accessible foreground/background contrast when a custom color is set.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- colorvar(--origam-color__neutral---200)
- Bar background.
- dimensionvar(--origam-space---12)
- Bar height before density adjustment.
- shadow0px -6px 24px 0px rgba(0,0,0,0.05), 0px 0px 0px 1px rgba(0,0,0,0.08)
- Shadow with negative offsetY (projects upward) for elevated variant.
- othercenter
- Content row flex justification.
- dimensionvar(--origam-space---2)
- Compact density offset (+8 px reduction).
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic bottom navigation
Shift mode
Custom item slot