Skip to content

Commit

Permalink
fix(docs): <header> reference (#1105)
Browse files Browse the repository at this point in the history
`<header>` element might have been at some point a special element that
could render as a sibling of `<body>`, but that is no longer the case:
it is now just an alias of `<view>`. We might want to restore this
original intent though in a future iteration.

Co-authored-by: flochtililoch <flochtililoch@gmail.com>
  • Loading branch information
flochtililoch and flochtililoch authored Feb 28, 2025
1 parent 15ea090 commit f841e04
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions docs/reference_header.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,25 @@ sidebar_label: <header>

The `<header>` element represents the header of a screen in the app. Typically, the header shows a title and navigation elements

An example header on a screen with a scrolling body.
An example header on a screen with a scrolling view.

```xml
<screen>
<header style="MyHeader">
<text href="#">Back</text>
<text>My App</text>
</header>
<body style="Flex" scroll="true">
<view style="FlexHorizontal">
<text>Basic view</text>
<text>With Horizontal Layout</text>
<body style="Flex">
<header style="MyHeader">
<text href="#">Back</text>
<text>My App</text>
</header>
<view scroll="true" style="Flex">
<view style="FlexHorizontal">
<text>Basic view</text>
<text>With Horizontal Layout</text>
</view>
</view>
</body>
</screen>
```

## Structure

A `<header>` element can only appear as a direct child of a `<screen>` element.

## Attributes

- [Behavior attributes](#behavior-attributes)
Expand Down

0 comments on commit f841e04

Please sign in to comment.