-
Notifications
You must be signed in to change notification settings - Fork 3
/
AlignVertical.tsx
51 lines (48 loc) · 1.22 KB
/
AlignVertical.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import * as React from "react";
import { ToggleButton, ToggleButtonGroup } from "@mui/material";
import {
VerticalAlignBottom,
VerticalAlignCenter,
VerticalAlignTop
} from "@mui/icons-material";
import { AlignVerticalProps } from "./AlignVertical.types";
/**
* Vertical alignment button group component to toggle between top/center/bottom alignment
*/
export default function AlignVertical({
disabled = false,
onChange,
orientation = "horizontal",
size = "medium",
value = "top"
}: AlignVerticalProps) {
return (
<ToggleButtonGroup
aria-label="vertical alignment"
disabled={disabled}
exclusive
onChange={onChange}
orientation={orientation}
size={size}
value={value}
>
<ToggleButton aria-label="top aligned" value="top" data-testid="top">
<VerticalAlignTop />
</ToggleButton>
<ToggleButton
aria-label="vertically centered"
value="center"
data-testid="center"
>
<VerticalAlignCenter />
</ToggleButton>
<ToggleButton
aria-label="bottom aligned"
value="bottom"
data-testid="bottom"
>
<VerticalAlignBottom />
</ToggleButton>
</ToggleButtonGroup>
);
}