Skip to content

Commit

Permalink
Update Button examples for Snaps (#1801)
Browse files Browse the repository at this point in the history
  • Loading branch information
Montoya authored Jan 11, 2025
1 parent 594a8ff commit b5839f4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Binary file modified snaps/assets/custom-ui-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified snaps/assets/custom-ui-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions snaps/features/custom-ui/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,18 +589,22 @@ Outputs a form for use in [interactive UI](interactive-ui.md).
#### Example
```js
import { Form, Input, Button } from "@metamask/snaps-sdk/jsx";
import { Box, Section, Form, Input, Button } from "@metamask/snaps-sdk/jsx";

const interfaceId = await snap.request({
method: "snap_createInterface",
params: {
ui: (
<Form name="form-to-fill">
<Field label="First Name">
<Input name="firstName" placeholder="Enter your first name" />
</Field>
<Button type="submit">Submit</Button>
</Form>
<Box>
<Section>
<Form name="form-to-fill">
<Field label="First Name">
<Input name="firstName" placeholder="Enter your first name" />
</Field>
<Button type="submit">Submit</Button>
</Form>
</Section>
</Box>
),
},
});
Expand Down

0 comments on commit b5839f4

Please sign in to comment.