# Fab

> Atom — orn-ui

> ⚠️ Requiere <UIProvider>: Este componente (como todos los de orn-ui) debe renderizarse dentro de un ancestro <UIProvider>, o lanza un error en runtime. See https://orn-ui-docs.vercel.app/getting-started.md

> Corre en Expo SDK 54, 55, 56 y 57, y en React Native puro >=0.81 con react >=19.1. Sin módulos nativos — funciona en Expo Go, sin prebuild.

## Instalación

Instala solo este componente (copia el código fuente a tu proyecto, sin dependencia npm)
```bash
npx orn-ui add fab
```

O instala el paquete completo e impórtalo
```tsx
pnpm add orn-ui
import { Fab } from 'orn-ui/fab';
```

Depende de: core (theme + icons), pressable-scale

## Variantes

### Default

```tsx
<View style={{ height: 90 }}>
  <Fab onPress={() => {}} accessibilityLabel="Create invoice" bottom={0} right={0} />
</View>
```

### Custom

```tsx
<View style={{ height: 90 }}>
  <Fab onPress={() => {}} accessibilityLabel="Search" iconName="search" color="#00cae1" size={48} bottom={0} right={0} />
</View>
```

## Código completo del demo

```tsx
const variants: VariantDef[] = [
  {
    label: 'Default',
    content: (
      <View style={{ height: 90 }}>
        <Fab onPress={() => {}} accessibilityLabel="Create invoice" bottom={0} right={0} />
      </View>
    ),
  },
  {
    label: 'Custom',
    content: (
      <View style={{ height: 90 }}>
        <Fab onPress={() => {}} accessibilityLabel="Search" iconName="search" color="#00cae1" size={48} bottom={0} right={0} />
      </View>
    ),
  },
];
return <VariantList variants={variants} />;
```

## Props

| Nombre | Tipo | Por defecto | Descripción |
|---|---|---|---|
| `onPress` | `(e: GestureResponderEvent) => void` | — | — |
| `iconName?` | `IconName` | plus | — |
| `icon?` | `ReactNode` | — | — |
| `size?` | `number` | 60 | — |
| `bottom?` | `number` | 20 | — |
| `right?` | `number` | 20 | — |
| `color?` | `string` | — | — |
| `style?` | `StyleProp<ViewStyle>` | — | — |
| `accessibilityLabel` | `string` | — | — |
