diff --git a/resources/views/docs/mobile/4/edge-components/icon.md b/resources/views/docs/mobile/4/edge-components/icon.md index 91e72f92..0e45e309 100644 --- a/resources/views/docs/mobile/4/edge-components/icon.md +++ b/resources/views/docs/mobile/4/edge-components/icon.md @@ -44,7 +44,7 @@ to work on both platforms, see the [Icon name reference](#icon-name-reference) b @verbatim ```blade - + @@ -57,7 +57,7 @@ to work on both platforms, see the [Icon name reference](#icon-name-reference) b @verbatim ```blade - + Verified diff --git a/resources/views/docs/mobile/4/edge-components/layout.md b/resources/views/docs/mobile/4/edge-components/layout.md index 2c22151d..c708347c 100644 --- a/resources/views/docs/mobile/4/edge-components/layout.md +++ b/resources/views/docs/mobile/4/edge-components/layout.md @@ -119,15 +119,9 @@ for "fill the remaining space along the parent's main axis." ## Alignment -Alignment values are integers that map to standard flex alignment: - -| Value | Meaning | -|-------|---------| -| `0` | start | -| `1` | center | -| `2` | end | -| `3` | stretch | -| `4` | baseline | +Alignment attributes accept a **readable label**, a backing **enum**, or the raw **integer** — all three resolve to +the same value the native layout reads. Labels read best in Blade; enums give you autocomplete and type-safety when +building elements fluently in PHP. @verbatim ```blade static @@ -137,23 +131,50 @@ Alignment values are integers that map to standard flex alignment: {{-- Cross-axis alignment (horizontal in a column) --}} - + Centered text {{-- Main-axis distribution --}} - + Left Right ``` @endverbatim -- `align-items` - Cross-axis alignment for children (int, 0-4) -- `justify-content` - Main-axis distribution (int, 0=start, 1=center, 2=end, 3=space-between, 4=space-around, 5=space-evenly) -- `align-self` - Override parent's `align-items` for this element (int, 0-4) +- `align-items` - Cross-axis alignment for children — `start`, `center`, `end`, `stretch` +- `justify-content` - Main-axis distribution — `start`, `center`, `end`, `space-between`, `space-around`, `space-evenly` +- `align-self` - Override the parent's `align-items` for this element — `start`, `center`, `end`, `stretch` - `center` - Shorthand: sets both `align-items` and `justify-content` to center (boolean) +### Underlying values + +Labels map to these integers, which still work if you prefer them (`align-items="1"`): + +| Integer | `align-items` / `align-self` | `justify-content` | +|---------|------------------------------|-------------------| +| `0` | start | start | +| `1` | center | center | +| `2` | end | end | +| `3` | stretch | space-between | +| `4` | — | space-around | +| `5` | — | space-evenly | + +### In PHP + +When you build elements fluently, pass a label, an enum case, or an integer. The enums live in +`Native\Mobile\Edge\Enums` — `AlignItems`, `AlignSelf`, `JustifyContent`, and `TextAlign`: + +```php +use Native\Mobile\Edge\Elements\Column; +use Native\Mobile\Edge\Enums\AlignItems; + +Column::make() + ->alignItems(AlignItems::Center) // enum — autocompletes, type-checked + ->justifyContent('space-between'); // label string — also fine +``` +