Skip to content

Custom Components

Brandon Jordan edited this page Sep 10, 2023 · 8 revisions

Create a file that exports an array of elements to create a component you can use in a main view.

nav.js:

import {Header,Text} from 'javascript-ui';

export default [
	Header([
		Image('logo.png')
	])
]

main.js:

import {view} from 'javascript-ui';
import * as Nav from './nav.js'

window.onload = () => {
    view([
        Nav,
        Section([
            // ..
        ])
    ])
};

Clone this wiki locally