Skip to content

Commit 667bcf8

Browse files
Add Section Snaps Component in Custom UI (#1700)
* Add Section Snaps Component in Custom UI This closes #1699 * Update snaps/features/custom-ui/index.md --------- Co-authored-by: Alexandra Carrillo <[email protected]>
1 parent a5d9f17 commit 667bcf8

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

snaps/assets/custom-ui-section.png

16 KB
Loading

snaps/features/custom-ui/index.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,40 @@ await snap.request({
783783
<img src={require("../../assets/custom-ui-row.png").default} alt="Row UI example" width="450px" style={{border: "1px solid #DCDCDC"}} />
784784
</p>
785785
786+
### `Section`
787+
788+
Outputs a styled container for use in [dialogs](dialogs.md) and [home pages](home-pages.md).
789+
790+
#### Props
791+
792+
- `direction` - (Optional) The direction in which elements flow inside the box.
793+
Possible values are `"horizontal"` and `"vertical"`.
794+
The default is `"vertical"`.
795+
- `alignment` - (Optional) The alignment of the elements inside the box.
796+
Possible values are `"start"`, `"center"`, `"end"`, `"space-between"`, and `"space-around"`.
797+
The default is `"start"`.
798+
799+
#### Example
800+
801+
```js
802+
export const onHomePage: OnHomePageHandler = async () => {
803+
return {
804+
content: (
805+
<Box>
806+
<Section>
807+
<Heading>Hello world!</Heading>
808+
<Text>This text appears in a container with rounded corners.</Text>
809+
</Section>
810+
</Box>
811+
),
812+
};
813+
};
814+
```
815+
816+
<p align="center">
817+
<img src={require("../../assets/custom-ui-section.png").default} alt="Section UI example" width="450px" style={{border: "1px solid #DCDCDC"}} />
818+
</p>
819+
786820
### `Selector`
787821
788822
Outputs a selector component for use in [interactive UI](interactive-ui.md).

0 commit comments

Comments
 (0)