Fix/16207/text component storybook (#16214)

feature/default_network_editable
Garrett Bear 2 years ago committed by GitHub
parent c00749dcf7
commit 4581a3ac77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui/components/component-library/text/README.mdx
  2. 19
      ui/components/component-library/text/text.stories.js

@ -269,6 +269,7 @@ import { Text } from '../../ui/component-library/text';
<Text as="p">p</Text>
<Text as="span">span</Text>
<Text as="strong">strong</Text>
<Text as="input" placeholder="input"></Text>
```
Renders the html:
@ -288,6 +289,7 @@ Renders the html:
<p>p</p>
<span>span</span>
<strong>strong</strong>
<input placeholder="input" />
```
### Box Props

@ -259,12 +259,17 @@ export const Ellipsis = (args) => (
export const As = (args) => (
<>
{Object.values(ValidTags).map((tag) => (
<div key={tag}>
<Text {...args} as={tag}>
{tag}
</Text>
</div>
))}
{ValidTags.map((tag) => {
if (tag === 'input') {
return <Text key={tag} {...args} as={tag} placeholder={tag} />;
}
return (
<div key={tag}>
<Text {...args} as={tag}>
{tag}
</Text>
</div>
);
})}
</>
);

Loading…
Cancel
Save