Skip to content
Snippets Groups Projects
Commit 51f7ddce authored by Alf Eaton's avatar Alf Eaton
Browse files

Add initial Menu implementation

parent 0826713a
No related branches found
No related tags found
No related merge requests found
.menuContainer {
position: relative;
}
.opener {
border: none;
cursor: pointer;
background: transparent;
font-size: inherit;
display: flex;
align-items: center;
/*min-width: 10em;*/
/*justify-content: end;*/
}
.opener:hover,
.opener:hover .placeholder {
color: cornflowerblue;
}
.placeholder {
color: gray;
}
.arrow {
margin-left: 10px;
font-size: 50%;
}
.menu {
position: absolute;
top: 0;
left: 0;
min-width: 10em;
background-color: white;
border-left: 1px solid #aaa;
border-bottom: 1px solid #aaa;
/*columns: 2 auto;*/
}
.option {
cursor: pointer;
padding: 10px;
}
.option:hover {
color: cornflowerblue;
}
.active {
color: cornflowerblue;
}
A menu for selecting one of a list of options.
```js
const options = [
{ value: 'foo', label: 'Foo' },
{ value: 'bar', label: 'Bar' },
{ value: 'baz', label: 'Baz' }
];
<Menu
options={options}
onChange={event => console.log(event.target.value)}/>
```
When an option is selected, it replaces the placeholder.
```js
const options = [
{ value: 'foo', label: 'Foo' },
{ value: 'bar', label: 'Bar' },
{ value: 'baz', label: 'Baz' }
];
<Menu
options={options}
value="foo"
onChange={event => console.log(event.target.value)}/>
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment