Layouts

Customize the layout of your app by overwriting or modifying the default layout.

Custom Layout

Evidence will use any +layout.svelte file in the /pages directory to override the default layout.

You can customize the EvidenceDefaultLayout with the options below, or replace the contents of the file with an entirely new layout. If you include a +layout.svelte file in a directory, markdown files in that directory (and its subdirectories) will use this layout file instead of the default layout.

You can also add your own HTML elements to the default page layout.

Examples

Hide sidebar on all pages

<EvidenceDefaultLayout {data} hideSidebar=true >
	<slot slot="content" />
</EvidenceDefaultLayout>

With a logo file in ./static/my-logo.png.

<EvidenceDefaultLayout {data} logo="/my-logo.png" >
	<slot slot="content" />
</EvidenceDefaultLayout>

Options

The EvidenceDefaultLayout component includes a number of features on every page that can be removed or customized via props

Page Settings

App title that will replace the Evidence Logo.

Options:
Any string

Name of the home page in the sidebar.

Options:
Any string
Default:
Home

Sets the width of the app content to the full width of the screen.

Options:
Default:
false

Sets the width of the app content in pixels. The default layout is about 1,280 px wide.

Options:
Any number

Display a subtle link to the Evidence website at the bottom of the sidebar.

Options:
Default:
false

Hide Elements

Removes the option to show queries when the app is deployed. Has no effect in development.

Options:
Default:
false

Hides the sidebar navigation

Options:
Default:
false

Hides the page header

Options:
Default:
false

Hides the breadcrumbs which appear at the top of the page

Options:
Default:
false

Hides the table of contents (on-page links at top right of page)

Options:
Default:
false

Link to a Github Repo which will appear in the header using the Github Logo

Default:
https://github.com/evidence-dev/evidence

Link to an X (Twitter) profile which will appear in the header using the X Logo

Default:
https://twitter.com/evidence_dev

Link to a Bluesky profile which will appear in the header using the Bluesky Logo

Default:
https://bsky.app/profile/evidence.dev

Link to a slack community which will appear in the header using the slack Logo

Default:
https://slack.evidence.dev

Object containing Algolia docsearch credentials

Options:
{{appId: 'xxx', apiKey: 'xxx', indexName: 'xxx'}}