Skip to content

Commit 82fe23f

Browse files
authored
1 parent e87e2ba commit 82fe23f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/Offcanvas.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import OffcanvasTitle from './OffcanvasTitle';
1919
import { BsPrefixRefForwardingComponent } from './helpers';
2020
import { useBootstrapPrefix } from './ThemeProvider';
2121

22-
export type OffcanvasPlacement = 'start' | 'end' | 'bottom';
22+
export type OffcanvasPlacement = 'start' | 'end' | 'top' | 'bottom';
2323

2424
export interface OffcanvasProps
2525
extends Omit<
@@ -66,7 +66,12 @@ const propTypes = {
6666
/**
6767
* Which side of the viewport the offcanvas will appear from.
6868
*/
69-
placement: PropTypes.oneOf<OffcanvasPlacement>(['start', 'end', 'bottom']),
69+
placement: PropTypes.oneOf<OffcanvasPlacement>([
70+
'start',
71+
'end',
72+
'top',
73+
'bottom',
74+
]),
7075

7176
/**
7277
* When `true` The offcanvas will automatically shift focus to itself when it

www/src/examples/Offcanvas/Placement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function OffCanvasExample({ name, ...props }) {
2525
function Example() {
2626
return (
2727
<>
28-
{['start', 'end', 'bottom'].map((placement, idx) => (
28+
{['start', 'end', 'top', 'bottom'].map((placement, idx) => (
2929
<OffCanvasExample key={idx} placement={placement} name={placement} />
3030
))}
3131
</>

www/src/pages/components/offcanvas.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ actions whenever possible, or provide an explicit dismiss action.
3030
Offcanvas supports a few different placements:
3131
- `start` places offcanvas on the left of the viewport
3232
- `end` places offcanvas on the right of the viewport
33+
- `top` places offcanvas on the top of the viewport
3334
- `bottom` places offcanvas on the bottom of the viewport
3435

3536
<ReactPlayground codeText={Placement} />

0 commit comments

Comments
 (0)