EditableH2
Basic
Lorem ipsum dolor...
<EditableH2
text={basicExampleText}
onChange={(newText) => {
setBasicExampleText(newText);
}}
/>
Empty state with placeholder
Empty state text
<EditableH2
emptyStateText="Empty state text"
text={emptyStateExampleText}
onChange={(newText) => {
if (newText.length > 0) {
setEmptyStateExampleText(newText);
}
}}
inputProps={{ placeholder: "Placeholder text..." }}
/>
...rest
Whatever you pass to
...rest
will get passed to H2
andInput
. If instead you want to pass props to only one of those two components, you can use h2
orinputProps
.Lorem ipsum dolor...
<EditableH2
text={restExampleText}
onChange={(newText) => {
setRestExampleText(newText);
}}
className="text-supporting-green-500"
/>
Props
Prop | Required | Default | Type and notes |
---|---|---|---|
text | - |
| |
onChange | - |
| |
emptyStateText | - | - |
|
h2Props | - | - |
Gets passed to H2 . |
inputProps | - | - |
Gets passed to Input . |
...rest | - | - |
Whatever you pass to ...rest will get passed to H2 andInput . If instead you want to pass props to only one of those two components, you can use h2 orinputProps . |