MoreSheet
Los lugares que no caben en la barra de abajo del celular, de a dos en una hoja que sube desde abajo.
import { MoreSheet, MobileNav } from '@sypnia/ui/react'
En esta página
La hoja detrás de Más
Pulsa «More».
Código
import { useState } from 'react';
import { MobileNav, type NavItem, type RenderLink } from '@sypnia/ui/react';
// Five places with their names and «More» for the rest. Press More: the others open in a sheet, two by two.
const items: NavItem[] = [
{ href: '/tables', label: 'Tables', icon: 'table' }, { href: '/sql', label: 'SQL', icon: 'query' }, { href: '/users', label: 'Users', icon: 'users' },
{ href: '/keys', label: 'API keys', icon: 'key' }, { href: '/logs', label: 'Logs', icon: 'logs' }, { href: '/policies', label: 'Policies', icon: 'shield' },
{ href: '/settings', label: 'Settings', icon: 'settings' }, { href: '/account', label: 'Account', icon: 'user', foot: true },
];
export default function Bottom() {
const [current, setCurrent] = useState('/tables');
const link: RenderLink = ({ href, children, ...p }) => <a {...p} href={`#${href}`} onClick={(e) => { e.preventDefault(); setCurrent(href); p.onClick?.(); }}>{children}</a>;
return <MobileNav items={items} current={current} renderLink={link} />;
} Cuándo usarlo
Úsalo cuando
- Detrás de «Más» en MobileNav, que la abre por ti.
No lo uses cuando
- Acciones: guarda lugares, no comandos.
Para todos
- Es un diálogo llamado «Más»; Escape lo cierra y el foco vuelve a «Más».
Props
| MoreSheet | Tipo | Por defecto |
|---|---|---|
itemsobligatorio | NavItem[] | |
onCloseobligatorio | () => void | |
openobligatorio | boolean | |
current | string | |
renderLink | RenderLink | ({ children, ...p }) => <a {...p}>{children}</a> |
| MobileNav | Tipo | Por defecto |
|---|---|---|
currentobligatorio | string | |
itemsobligatorio | NavItem[] | |
renderLink | RenderLink | ({ children, ...p }) => <a {...p}>{children}</a> |