diff --git a/docs/_includes/layouts/component.njk b/docs/_includes/layouts/component.njk index 7aa1416f..ab17d439 100644 --- a/docs/_includes/layouts/component.njk +++ b/docs/_includes/layouts/component.njk @@ -105,25 +105,29 @@ text: 'Messages', href: ('/components/messages' | url) }, - { - text: 'Ticket panel', - href: ('/components/ticket-panel' | url) - }, - { - text: 'Timeline', - href: ('/components/timeline' | url) - }, { text: 'Multi select', href: ('/components/multi-select' | url) }, + { + text: 'Scrollable pane', + href: ('/components/scrollable-pane' | url) + }, { text: 'Sortable table', href: ('/components/sortable-table' | url) + }, + { + text: 'Ticket panel', + href: ('/components/ticket-panel' | url) + }, + { + text: 'Timeline', + href: ('/components/timeline' | url) } ] } - ] + ] }) }} diff --git a/docs/components/scrollable-pane.md b/docs/components/scrollable-pane.md new file mode 100644 index 00000000..0840ae49 --- /dev/null +++ b/docs/components/scrollable-pane.md @@ -0,0 +1,18 @@ +--- +layout: layouts/component.njk +title: Scrollable pane +--- + +{% example "/examples/scrollable-pane", 470 %} + +## When to use + +Use the scrollable pane component when you have content (typically tables) which unavoidably overflowing the page. It adds scroll shadows to indicate that content overflows the page. + +This is often used in the [filter a list](../../patterns/filter-a-list/) pattern as the filter takes up additional horizontal space, causing the pane holding the table to shrink. + +## When not to use + +Before using this, try to avoid having content that overflows the page at all. Users should be able to see all of the page's content without needing to scroll, so this component should only be used when absolutely necessary. + +Do not use this component to contain tables which have multi-line text. It will not allow the content to overflow vertically. diff --git a/docs/examples/scrollable-pane/index.njk b/docs/examples/scrollable-pane/index.njk new file mode 100644 index 00000000..626bdb1b --- /dev/null +++ b/docs/examples/scrollable-pane/index.njk @@ -0,0 +1,259 @@ +--- +layout: layouts/example.njk +title: Sortable table (example) +--- + +{%- from "govuk/components/table/macro.njk" import govukTable -%} + +