Product UI

Button

experimentalLa API puede cambiar sin una versión mayor. Desde la versión 0.1.0.

Botón de acción de las interfaces de producto: secundario por defecto; el primario neón presionable es la acción principal de la pantalla.

import { Button } from '@pipepath/product-ui';

Ejemplos

Secundario y primario
tema oscuro
arcade claro
Tamaño compacto, con ícono
tema oscuro
arcade claro
Deshabilitado y en espera
tema oscuro
arcade claro

Props

Props de Button, leídas de sus tipos de TypeScript
PropTipoPor defectoDescripción (en inglés, desde el código)
children (obligatoria)ReactNode—Visible text, always from the consumer: an infinitive verb («Crear túnel»).
classNamestring—
disabledbooleanfalseNot focusable and not pressable. Say why next to it when it is not obvious.
iconIconName—Decorative icon before the text, from `@pipepath/icons`.
onPress() => void—Called on mouse, touch, keyboard (Enter, Space) and screen reader activation.
pendingbooleanfalseBusy: keeps focus, ignores presses and tells screen readers it is loading.
refRef<HTMLButtonElement>—
size'md' | 'sm''md'`sm` for dense rows and toolbars.
type'button' | 'submit' | 'reset''button'Native button type.
variant'primary' | 'secondary''secondary'Visual weight. `primary` is the pressable neon button of the screen's main action: one per screen.

Cuándo usarlo

Cuándo no usarlo

Texto

Verbo en infinitivo que dice exactamente lo que hace: «Crear túnel», «Copiar dirección». El texto siempre lo pones tú; el ícono es decorativo.

Teclado