# FullscreenModalLayout
Provides the layout structure, overlay, focus trapping, and animations for fullscreen modals. Intended for internal use within Modal component variants.
## Import
```tsx
import { FullscreenModalLayout } from '@coinbase/cds-web/overlays/modal/FullscreenModalLayout'
```
## Examples
### Basic usage
This component is primarily used internally by the `Modal` component to provide the animated layout for fullscreen modals. It wraps your modal content and manages the overlay, animations, and focus trapping.
```tsx live
function Example() {
const [visible, setVisible] = useState(false);
const triggerRef = useRef(null);
const toggleOn = useCallback(() => setVisible(true), []);
const toggleOff = useCallback(() => setVisible(false), []);
const headerContent = (
Modal
);
const mainContent = (
{loremIpsum}
);
return (
{headerContent}
{mainContent}
);
}
```
### Three-column layout with FullscreenModalHeader and PageFooter
This example demonstrates a three-column layout structure with a FullscreenModalHeader at the top and PageFooter at the bottom, matching the tertiary + secondary + primary column pattern. The layout includes vertical dividers between columns and demonstrates how to structure complex modal content.
```tsx live
function ThreeColumnExample() {
const [visible, setVisible] = useState(false);
const triggerRef = useRef(null);
const toggleOn = useCallback(() => setVisible(true), []);
const toggleOff = useCallback(() => setVisible(false), []);
const listCellProps = {
spacingVariant: 'compact' as const,
outerSpacing: { paddingX: 0, paddingY: 0 },
innerSpacing: { paddingX: 0, paddingY: 0 },
};
const smallButtonProps = {
size: 'small' as const,
compact: true,
};
return (
}
title="Account Settings"
borderedBottom
flexShrink={0}
end={
Help
}
/>
{}} />
{}} />
{}} />
{}} />
Security Settings
Manage your account security preferences and authentication methods.
Email and Password
Change
}
/>
}
action={
}
/>
Two-Factor Authentication
Enable
}
/>
Enable
}
/>
Active Sessions
Revoke
}
/>
Revoke
}
/>
Revoke
}
/>
Security Alerts
Configure
}
/>
Configure
}
/>
Backup Codes
Save these codes in a safe place. You can use them to access your account if you
lose access to your two-factor authentication device.
API Keys
Manage API keys for programmatic access to your account. Keep them secure and
never share them publicly.
Account Recovery
Set up recovery options to help you regain access to your account if you're locked
out.
Change
}
/>
Change
}
/>
Security Tips
Use a unique password that you don't use elsewhere
Enable two-factor authentication for added security
Regularly review your active sessions and devices
Need Help?
If you're having trouble accessing your account, visit our{' '}
support center
{' '}
or contact support.
}
/>
);
}
```
## Props
| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `onRequestClose` | `() => void` | Yes | `-` | Callback function fired when modal is closed. |
| `visible` | `boolean` | Yes | `false false` | Controls visibility of the Modal |
| `accessibilityLabelledBy` | `string` | No | `-` | On web, maps to aria-labelledby and lists the id(s) of the element(s) that label the element on which the attribute is set. On mobile (Android only), a reference to another element nativeID used to build complex forms. |
| `disableFocusTrap` | `boolean` | No | `false` | Set disableFocusTrap to disable keyboard listeners responsible for focus trap behavior This can be useful for scenarios like Yubikey 2fa Disables the focus trap to allow normal keyboard navigation. |
| `disablePortal` | `boolean` | No | `-` | Disable React portal integration |
| `focusTabIndexElements` | `boolean` | No | `false false` | Allow any element with tabIndex attribute to be focusable in FocusTrap, rather than only focusing specific interactive element types like button. This can be useful when having long content in a Modal. If true, the focus trap will include all elements with tabIndex values in the list of focusable elements. |
| `key` | `Key \| null` | No | `-` | - |
| `onDidClose` | `((() => void) & (() => void))` | No | `-` | Callback fired after the component is closed. |
| `ref` | `RefObject \| ((instance: HTMLDivElement \| null) => void) \| null` | No | `-` | - |
| `restoreFocusOnUnmount` | `boolean` | No | `true` | If true, the focus trap will restore focus to the previously focused element when it unmounts. WARNING: If you disable this, you need to ensure that focus is restored properly so it doesnt end up on the body |
| `role` | `dialog \| alertdialog` | No | `-` | WAI-ARIA Roles |
| `shouldCloseOnEscPress` | `boolean` | No | `true` | If pressing the esc key should close the modal |
| `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |