Version
has been released! Read the upgrade guide

Installation & quick start

The documentation on this page is considered legacy.

We will be updating this content to our new principle-based format in the near future.

1Installation

To install and save to your project's package.json dependencies, run:

npm install @royalnavy/fonts @royalnavy/react-component-library styled-components

Note: styled-components is a required peer dependency and is installed with the above command.

2Quick start

Here's a quick example to get you started:

1import React from 'react'
2import ReactDOM from 'react-dom'
3import '@royalnavy/fonts'
4import { GlobalStyleProvider, Button } from '@royalnavy/react-component-library'
5function App() {
6 return (
7 <GlobalStyleProvider>
8 <Button variant="primary">
9 Hello, World!
10 </Button>
11 </GlobalStyleProvider>
12 )
13}
14ReactDOM.render(<App />, document.querySelector('#app'))

The Royal Navy Design System provides guidance and tools for building high–quality Services within the UK Ministry of Defence. This project is open source and its source code is available on GitHub.

All content is available under the Apache 2.0 licence, except where otherwise stated.

© Crown copyright