Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions packages/dev/s2-docs/pages/s2/NumberField.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,35 @@ Use the `prefix` prop to display an additional element before the input in the n
```tsx render
"use client";
import {NumberField} from '@react-spectrum/s2/NumberField';
import {style} from '@react-spectrum/s2/style' with {type: 'macro'};

function Example() {
return (
<NumberField
label="Price"
/*- begin highlight -*/
prefix="USD"
/*- end highlight -*/
formatOptions={{style: 'currency', currency: 'USD', currencyDisplay: 'narrowSymbol'}}
placeholder="0.00" />
<div className={style({display: 'flex', flexDirection: 'column', gap: 8})}>
<div style={{font: 'title'}}>Dimensions</div>
<div className={style({display: 'flex', flexDirection: 'row', gap: 8})}>
<NumberField
aria-label="Width"
/*- begin highlight -*/
prefix="W"
/*- end highlight -*/
formatOptions={{style: 'unit', unit: 'inch'}}
defaultValue={10}
placeholder="0"
styles={style({width: 100})}
hideStepper />
<NumberField
aria-label="Height"
/*- begin highlight -*/
prefix="H"
/*- end highlight -*/
formatOptions={{style: 'unit', unit: 'inch'}}
defaultValue={10}
placeholder="0"
styles={style({width: 100})}
hideStepper />
</div>
</div>
);
}
```
Expand Down
1 change: 0 additions & 1 deletion packages/dev/s2-docs/pages/s2/TextField.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import {Avatar} from '@react-spectrum/s2/Avatar';
function Example() {
return (
<div className={style({display: 'flex', flexDirection: 'column', gap: 8})}>
<TextField label="Phone Number" prefix="#" placeholder="(000) 000-0000" type="tel" />
<TextField label="URL" prefix="https://" placeholder="example.com" />
<TextField label="Mention" prefix={<MentionIcon />} placeholder="username" />
<TextField label="User Email" prefix={<Avatar size={20} src="https://i.imgur.com/xIe7Wlb.png" />} placeholder="contact@example.com" />
Expand Down