Skip to content

Commit

Permalink
docs: clean up examples (#6853)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang authored Nov 10, 2024
1 parent 02c915a commit 03d5d19
Show file tree
Hide file tree
Showing 19 changed files with 122 additions and 232 deletions.
2 changes: 1 addition & 1 deletion www/docs/components/overlays.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ compliant.

Hover over the links below to see tooltips.

<CodeBlock language="jsx" live>
<CodeBlock language="jsx" live noInline>
{TooltipInCopy}
</CodeBlock>

Expand Down
2 changes: 1 addition & 1 deletion www/docs/examples/Button/Active.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function ActiveExample() {
<>
<Button variant="primary" size="lg" active>
Primary button
</Button>{' '}
</Button>
<Button variant="secondary" size="lg" active>
Button
</Button>
Expand Down
4 changes: 2 additions & 2 deletions www/docs/examples/Button/Disabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ function DisabledExample() {
<>
<Button variant="primary" size="lg" disabled>
Primary button
</Button>{' '}
</Button>
<Button variant="secondary" size="lg" disabled>
Button
</Button>{' '}
</Button>
<Button href="#" variant="secondary" size="lg" disabled>
Link
</Button>
Expand Down
14 changes: 7 additions & 7 deletions www/docs/examples/Button/OutlineTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Button from 'react-bootstrap/Button';
function OutlineTypesExample() {
return (
<>
<Button variant="outline-primary">Primary</Button>{' '}
<Button variant="outline-secondary">Secondary</Button>{' '}
<Button variant="outline-success">Success</Button>{' '}
<Button variant="outline-warning">Warning</Button>{' '}
<Button variant="outline-danger">Danger</Button>{' '}
<Button variant="outline-info">Info</Button>{' '}
<Button variant="outline-light">Light</Button>{' '}
<Button variant="outline-primary">Primary</Button>
<Button variant="outline-secondary">Secondary</Button>
<Button variant="outline-success">Success</Button>
<Button variant="outline-warning">Warning</Button>
<Button variant="outline-danger">Danger</Button>
<Button variant="outline-info">Info</Button>
<Button variant="outline-light">Light</Button>
<Button variant="outline-dark">Dark</Button>
</>
);
Expand Down
8 changes: 4 additions & 4 deletions www/docs/examples/Button/Sizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import Button from 'react-bootstrap/Button';
function SizesExample() {
return (
<>
<div className="mb-2">
<div className="d-flex gap-2 mb-2">
<Button variant="primary" size="lg">
Large button
</Button>{' '}
</Button>
<Button variant="secondary" size="lg">
Large button
</Button>
</div>
<div>
<div className="d-flex gap-2">
<Button variant="primary" size="sm">
Small button
</Button>{' '}
</Button>
<Button variant="secondary" size="sm">
Small button
</Button>
Expand Down
6 changes: 3 additions & 3 deletions www/docs/examples/Button/TagTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Button from 'react-bootstrap/Button';
function TagTypesExample() {
return (
<>
<Button href="#">Link</Button> <Button type="submit">Button</Button>{' '}
<Button as="input" type="button" value="Input" />{' '}
<Button as="input" type="submit" value="Submit" />{' '}
<Button href="#">Link</Button> <Button type="submit">Button</Button>
<Button as="input" type="button" value="Input" />
<Button as="input" type="submit" value="Submit" />
<Button as="input" type="reset" value="Reset" />
</>
);
Expand Down
14 changes: 7 additions & 7 deletions www/docs/examples/Button/Types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Button from 'react-bootstrap/Button';
function TypesExample() {
return (
<>
<Button variant="primary">Primary</Button>{' '}
<Button variant="secondary">Secondary</Button>{' '}
<Button variant="success">Success</Button>{' '}
<Button variant="warning">Warning</Button>{' '}
<Button variant="danger">Danger</Button>{' '}
<Button variant="info">Info</Button>{' '}
<Button variant="light">Light</Button>{' '}
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="success">Success</Button>
<Button variant="warning">Warning</Button>
<Button variant="danger">Danger</Button>
<Button variant="info">Info</Button>
<Button variant="light">Light</Button>
<Button variant="dark">Dark</Button>
<Button variant="link">Link</Button>
</>
Expand Down
12 changes: 6 additions & 6 deletions www/docs/examples/ButtonGroup/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function ToolbarExample() {
<>
<ButtonToolbar className="mb-3" aria-label="Toolbar with Button groups">
<ButtonGroup className="me-2" aria-label="First group">
<Button variant="secondary">1</Button>{' '}
<Button variant="secondary">2</Button>{' '}
<Button variant="secondary">3</Button>{' '}
<Button variant="secondary">1</Button>
<Button variant="secondary">2</Button>
<Button variant="secondary">3</Button>
<Button variant="secondary">4</Button>
</ButtonGroup>
<InputGroup>
Expand All @@ -30,9 +30,9 @@ function ToolbarExample() {
aria-label="Toolbar with Button groups"
>
<ButtonGroup aria-label="First group">
<Button variant="secondary">1</Button>{' '}
<Button variant="secondary">2</Button>{' '}
<Button variant="secondary">3</Button>{' '}
<Button variant="secondary">1</Button>
<Button variant="secondary">2</Button>
<Button variant="secondary">3</Button>
<Button variant="secondary">4</Button>
</ButtonGroup>
<InputGroup>
Expand Down
8 changes: 6 additions & 2 deletions www/docs/examples/ButtonGroup/ToolbarBasic.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ function ToolbarBasicExample() {
return (
<ButtonToolbar aria-label="Toolbar with button groups">
<ButtonGroup className="me-2" aria-label="First group">
<Button>1</Button> <Button>2</Button> <Button>3</Button>{' '}
<Button>1</Button>
<Button>2</Button>
<Button>3</Button>
<Button>4</Button>
</ButtonGroup>
<ButtonGroup className="me-2" aria-label="Second group">
<Button>5</Button> <Button>6</Button> <Button>7</Button>
<Button>5</Button>
<Button>6</Button>
<Button>7</Button>
</ButtonGroup>
<ButtonGroup aria-label="Third group">
<Button>8</Button>
Expand Down
2 changes: 1 addition & 1 deletion www/docs/examples/Card/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function GroupExample() {
<Card.Title>Card title</Card.Title>
<Card.Text>
This card has supporting text below as a natural lead-in to
additional content.{' '}
additional content.
</Card.Text>
</Card.Body>
<Card.Footer>
Expand Down
3 changes: 1 addition & 2 deletions www/docs/examples/Card/WithHeaderAndQuote.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ function WithHeaderAndQuoteExample() {
<Card.Body>
<blockquote className="blockquote mb-0">
<p>
{' '}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer
posuere erat a ante.{' '}
posuere erat a ante.
</p>
<footer className="blockquote-footer">
Someone famous in <cite title="Source Title">Source Title</cite>
Expand Down
2 changes: 1 addition & 1 deletion www/docs/examples/Dropdown/ButtonCustom.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function ButtonCustomExample() {
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>{' '}
</Dropdown>
<Dropdown as={ButtonGroup}>
<Button variant="info">mix it up style-wise</Button>
<Dropdown.Toggle split variant="success" id="dropdown-custom-2" />
Expand Down
67 changes: 32 additions & 35 deletions www/docs/examples/Dropdown/ButtonSizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,38 @@ import SplitButton from 'react-bootstrap/SplitButton';
function ButtonSizesExample() {
return (
<>
<div className="mb-2">
{[DropdownButton, SplitButton].map((DropdownType, idx) => (
<DropdownType
as={ButtonGroup}
key={idx}
id={`dropdown-button-drop-${idx}`}
size="lg"
title="Drop large"
>
<Dropdown.Item eventKey="1">Action</Dropdown.Item>
<Dropdown.Item eventKey="2">Another action</Dropdown.Item>
<Dropdown.Item eventKey="3">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</DropdownType>
))}
</div>
<div>
{[DropdownButton, SplitButton].map((DropdownType, idx) => (
<DropdownType
as={ButtonGroup}
key={idx}
id={`dropdown-button-drop-${idx}`}
size="sm"
variant="secondary"
title="Drop small"
>
<Dropdown.Item eventKey="1">Action</Dropdown.Item>
<Dropdown.Item eventKey="2">Another action</Dropdown.Item>
<Dropdown.Item eventKey="3">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</DropdownType>
))}
</div>
{[DropdownButton, SplitButton].map((DropdownType, idx) => (
<DropdownType
as={ButtonGroup}
key={idx}
id={`dropdown-button-drop-${idx}`}
size="lg"
title="Drop large"
>
<Dropdown.Item eventKey="1">Action</Dropdown.Item>
<Dropdown.Item eventKey="2">Another action</Dropdown.Item>
<Dropdown.Item eventKey="3">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</DropdownType>
))}

{[DropdownButton, SplitButton].map((DropdownType, idx) => (
<DropdownType
as={ButtonGroup}
key={idx}
id={`dropdown-button-drop-${idx}`}
size="sm"
variant="secondary"
title="Drop small"
>
<Dropdown.Item eventKey="1">Action</Dropdown.Item>
<Dropdown.Item eventKey="2">Another action</Dropdown.Item>
<Dropdown.Item eventKey="3">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</DropdownType>
))}
</>
);
}
Expand Down
78 changes: 37 additions & 41 deletions www/docs/examples/Dropdown/DropDirections.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,47 @@ import Dropdown from 'react-bootstrap/Dropdown';
import DropdownButton from 'react-bootstrap/DropdownButton';
import SplitButton from 'react-bootstrap/SplitButton';

function DropDirectioExample() {
function DropDirectionExample() {
return (
<>
<div className="mb-2">
{['up', 'up-centered', 'down', 'down-centered', 'start', 'end'].map(
(direction) => (
<DropdownButton
as={ButtonGroup}
key={direction}
id={`dropdown-button-drop-${direction}`}
drop={direction}
variant="secondary"
title={` Drop ${direction} `}
>
<Dropdown.Item eventKey="1">Action</Dropdown.Item>
<Dropdown.Item eventKey="2">Another action</Dropdown.Item>
<Dropdown.Item eventKey="3">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</DropdownButton>
),
)}
</div>
{['up', 'up-centered', 'down', 'down-centered', 'start', 'end'].map(
(direction) => (
<DropdownButton
as={ButtonGroup}
key={direction}
id={`dropdown-button-drop-${direction}`}
drop={direction}
variant="secondary"
title={`Drop ${direction}`}
>
<Dropdown.Item eventKey="1">Action</Dropdown.Item>
<Dropdown.Item eventKey="2">Another action</Dropdown.Item>
<Dropdown.Item eventKey="3">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</DropdownButton>
),
)}

<div>
{['up', 'up-centered', 'down', 'down-centered', 'start', 'end'].map(
(direction) => (
<SplitButton
key={direction}
id={`dropdown-button-drop-${direction}`}
drop={direction}
variant="secondary"
title={`Drop ${direction}`}
>
<Dropdown.Item eventKey="1">Action</Dropdown.Item>
<Dropdown.Item eventKey="2">Another action</Dropdown.Item>
<Dropdown.Item eventKey="3">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</SplitButton>
),
)}
</div>
{['up', 'up-centered', 'down', 'down-centered', 'start', 'end'].map(
(direction) => (
<SplitButton
key={direction}
id={`dropdown-button-drop-${direction}`}
drop={direction}
variant="secondary"
title={`Drop ${direction}`}
>
<Dropdown.Item eventKey="1">Action</Dropdown.Item>
<Dropdown.Item eventKey="2">Another action</Dropdown.Item>
<Dropdown.Item eventKey="3">Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item eventKey="4">Separated link</Dropdown.Item>
</SplitButton>
),
)}
</>
);
}

export default DropDirectioExample;
export default DropDirectionExample;
Loading

0 comments on commit 03d5d19

Please sign in to comment.