@vention/machine-ui
v6.6.15
Published
Machine UI is Vention's component library for building applications and Human-Machine Interfaces (HMIs). This is the same library that Vention uses internally to build our own applications, now available for you to build custom applications for your Venti
Keywords
Readme
Machine UI
Machine UI is Vention's component library for building applications and Human-Machine Interfaces (HMIs). This is the same library that Vention uses internally to build our own applications, now available for you to build custom applications for your Vention machines.
Each component's props and their types are in the package's type declarations, which your editor and tsc read. Look there for props; this README covers only defaults, behaviour and composition that the types can't show.
🚀 Installation
Install Machine UI via npm:
npm install @vention/machine-uiFor the latest version and release notes, visit the npm package page.
Setup
Machine UI builds on MUI v5. The app needs the peer dependencies react and react-dom 17 and @mui/material 5, plus @emotion/react and @emotion/styled, which MUI needs. @tabler/icons-react, tss-react and react-draggable come with the package.
Wrap the app in MUI's ThemeProvider with one of the two themes:
machineUiTheme: the desktop theme. It sets the palette, the spacing scale (theme.spacing(n)reads[0, 4, 8, 12, 16, 24, 28, 32, 40, 48, 56, 64, 80, 96, 128]px) and the typography variants.machineUiHmiTheme: the touch HMI theme. It ismachineUiThemewith thicker icon strokes (1.5px instead of 1.01px). Palette, spacing and typography are the same, so touch sizing comes from each component'ssizeprop, not from the theme (see Components).
Both themes add typography variants you can pass to MUI's Typography: heading36Bold, heading24SemiBold, heading24Medium, heading18SemiBold, heading16SemiBold, paragraph18Medium, paragraph18Regular, paragraph16Medium, paragraph16Regular, paragraph14Regular, code16Reg, code14Reg, code12Reg, uiText18SemiBold, uiText18Medium, uiText18Regular, uiText14SemiBold, uiText14Medium, uiText14Regular, uiText12SemiBold, uiText12Medium, uiText12Regular, uiTableNumbers14Reg, uiTableNumbers12Reg, and for HMIs hmiText20Regular, hmiText20SemiBold, hmiText22Regular, hmiText22Medium, hmiText22SemiBold, hmiText28SemiBold, hmiText32SemiBold.
COLORS holds the raw palette: COLORS.slate, COLORS.blue, COLORS.cyan, COLORS.green, COLORS.amber and COLORS.red, each keyed by shade (50, 100 to 900, 950), for example COLORS.slate[800]. Use it where a component takes a color string, such as VentionStatusDot's color.
Importing anything from the package applies its global styles (box-sizing: border-box on every element), so there is no CssBaseline to add. The themes use the Inter and Roboto Mono fonts, which the app loads itself, for example from Google Fonts in index.html:
<link href="https://fonts.googleapis.com/css2?family=Inter:[email protected]&family=Roboto+Mono&display=swap" rel="stylesheet" />import { ThemeProvider, Typography } from "@mui/material"
import { COLORS, VentionButton, VentionStatusIndicator, machineUiHmiTheme } from "@vention/machine-ui"
export function App() {
return (
<ThemeProvider theme={machineUiHmiTheme}>
<div style={{ backgroundColor: COLORS.slate[50], padding: 24 }}>
<Typography variant="hmiText28SemiBold">Cell 1</Typography>
<VentionStatusIndicator label="Running" dotColor={COLORS.green[500]} size="xx-large" />
<VentionButton size="xx-large" variant="filled-brand" onClick={() => console.log("start")}>
Start cycle
</VentionButton>
</div>
</ThemeProvider>
)
}Components
Every component is a named export of @vention/machine-ui. Most components take a size prop; the HMI sizes are x-large and xx-large.
Buttons, text inputs, selects and comboboxes share one height per size: x-small 16px, small 24px, medium 32px, large 40px, x-large 56px, xx-large 80px. A touch target should be at least 44px, so on a touch HMI use x-large or xx-large. At xx-large, input and select labels switch to hmiText20*; the value text and button labels keep their regular typography.
Components built on an MUI component (noted as "built on MUI X") accept that component's props too, so standard props such as onClick, value, checked and onChange work as they do in MUI.
Actions
VentionButton: the standard button.sizedefaults to"small"(24px), too small for touch, so usesize="x-large"or"xx-large"on touch screens.variantdefaults to"filled-brand". The label ischildren, elselabelText, and reads "Button" when both are missing.typedefaults to"button", so passtype="submit"to submit a form. Built on MUIButton.VentionIconButton: a square button that shows only an icon, passed aschildren. It takes the samevariantandsizeasVentionButton, with the same"small"default. Built on MUIIconButton.VentionDropdownButton: a button that opens a menu of its children. Pass aVentionMenuwrappingVentionMenu.Itemelements aschildren; the button renders children as-is, so bare items get no menu surface.VentionLink: an inline text link.externaldefaults to true and shows an external-link icon, so passexternal={false}for an in-app link. WithoutlabelTextit reads "Button".
Inputs
VentionTextInput: a text field built on MUITextField. Usestate("error","warning","success","disabled") instead ofdisabledanderror.leftItemTextandrightItemTextshow fixed text inside the field, such as a unit, andmaxCharactersshows a character count.VentionSuggestionsInput: aVentionTextInputthat shows a list of suggestions as the user types. Pass eithervalue(controlled) ordefaultValue, not both.VentionSelect: a dropdown select.onChangereceives the event, so readevent.target.value. Each entry inmenuItemsis aVentionSelectMenuItemor aVentionSelectDivider({ type: "divider" }). WithisMultiple,valueis an array. Built on MUISelect.VentionSelectSkeleton: the loading placeholder forVentionSelect, also available asVentionSelect.Skeleton.VentionCombobox: a searchable single-choice dropdown.groupsare matched to options by each option'sgroup.VentionTagsInput: a field that collects a list of text tags.VentionCheckbox: a checkbox with an optional label, built on MUIFormControlLabel, socheckedandonChangework as there. Its size prop ischeckboxSize.VentionRadio: a radio button, used inside MUI'sRadioGroup. Its size prop isradioSize. Built on MUIRadio.VentionRadioTile: a large selectable tile with a radio button, used inside MUI'sRadioGroup, good for touch choices. Built on MUIFormControlLabel.VentionSwitch: an on/off toggle.checkedis a string ("on","off","mixed"or"loading"), not a boolean, andonChangereceives"on"or"off".VentionSlider: a range slider built on MUISlider.largeThumbgives it a bigger handle, for touch.VentionCounter: a small pill that shows a number, such as a count of pending items.VentionStepper: a value with minus and plus buttons on each side.valueis displayed as is. PutonClickanddisabledfor each button inminusButtonPropsandplusButtonProps.VentionInputGroupLabel: a label placed beside a group of inputs.VentionUploadFile: one row in a list of uploaded files, with its status. Setstateto"indeterminate"while uploading.VentionDropZone: an area to drop or pick files.onFilesSelect(files)returns an array of error messages, empty when every file is valid.
Feedback
VentionAlert: an alert box with optional actions. A button or link shows when its text is set, so pair each text with its click handler, such asprimaryButtonTextwithonPrimaryButtonClick. Usesize="xx-large"on touch HMIs.VentionBanner: a full-width colored strip for a machine or page state.VentionCallout: an inline highlighted note with optional actions.VentionProgressBar: a horizontal progress bar.valueruns from 0 to 100.VentionSpinner: a circular progress indicator. Withtype="progress"it showsvalue, from 0 to 100.VentionSkeleton: a loading placeholder.variant("text","rounded"or"circular") decides which other props it needs.VentionStatusDot: a small colored dot.dotColortakes the same colors asVentionBadge:"red","blue","green","yellow"or"slate". The oldercolor, which takes any CSS color, is deprecated.VentionStatusIndicator: a status dot with a text label, such as a machine state. Usesize="xx-large"on touch HMIs.VentionBadge: a small labeled tag. Pair the color with a text label, since color alone is hard to read on a shop floor.VentionTooltip: a tooltip on hover or focus, built on MUITooltip.placementdefaults to"top-end". Hover does not exist on touch screens, so don't put information an operator needs only in a tooltip.
Overlays
VentionModal: a dialog with a title, body and up to two buttons.typesets the icon.backDropClickClosabledefaults to true.widthoverrides the width thatmodalSizesets. SetisTouchDeviceon touch HMIs for larger padding, icons, text and buttons.VentionModalBase: the empty modal frame for custom content. SetisTouchDeviceon touch HMIs.VentionModalBanner: a colored banner to place at the top of a modal.VentionDrawer: a panel that slides in from a screen edge, built on MUIDrawer. WhenonDrawerHandleClickis set, the drawer stays mounted and shows a handle that calls it to toggle.VentionPopover: a floating card with an arrow, pointing at an element or a position. Place it withanchorElement(anHTMLElement) orpos2D({ top, left }in px).buttonstakes up to threeVentionButtonprops objects.VentionMenu: a menu list that closes when the user clicks outside it.showMenuandcloseMenuOnClickdefault to true. Fill it withVentionMenu.Item(subMenuItemsmakes a nested menu),VentionMenu.HeaderandVentionMenu.Divider.VentionPositionedComponent: places itschildrenat a fixed position that stays inside the viewport. Pass eitheranchorRect(aDOMRect, such as fromgetBoundingClientRect()) orposition({ top, left }), not both.
Navigation and layout
VentionTabs: a row of tabs.valueis the index of the selected tab, andonChange(event, index)receives the new index.VentionSteps: a vertical list of steps for a guided procedure. Usesize="xx-large"on touch HMIs;"small"always shows dots.VentionSidebarItem: a profile entry in a sidebar.VentionTreeItem: one row of a tree, with nestedVentionTreeItemchildren.VentionDraggable: a floating panel the user can drag around the screen.tabLocationshows a drag handle on that side; without it the whole panel drags.
Identity
VentionAvatar: a round user picture or initials.VentionPersonCard: an avatar with a name and a description line.VentionPersonCardSkeleton: the loading placeholder forVentionPersonCard, also available asVentionPersonCard.Skeleton.VentionIcon: an icon from the Vention icon set.typeis an icon name such as"player-play"or"status-warning-hmi".sizeis in px and defaults to 24. Icon strokes follow the theme, so they are thicker undermachineUiHmiTheme. For other icons,@tabler/icons-reactis installed with the package.
A small touch panel that uses several of these:
import { useState } from "react"
import { VentionModal, VentionSelect, VentionSwitch } from "@vention/machine-ui"
export function RecipePanel() {
const [recipe, setRecipe] = useState<string>("small-box")
const [vacuum, setVacuum] = useState<"on" | "off">("off")
const [pendingRecipe, setPendingRecipe] = useState<string | null>(null)
return (
<>
<VentionSelect
size="xx-large"
variant="outlined"
labelText="Recipe"
value={recipe}
onChange={event => setPendingRecipe(String(event.target.value))}
menuItems={[
{ value: "small-box", displayText: "Small box" },
{ value: "large-box", displayText: "Large box" },
{ type: "divider" },
{ value: "custom", displayText: "Custom", isDisabled: true },
]}
/>
<VentionSwitch size="xx-large" labelText="Vacuum" checked={vacuum} onChange={setVacuum} />
<VentionModal
isOpen={pendingRecipe !== null}
onClose={() => setPendingRecipe(null)}
isTouchDevice
type="warning"
titleText="Change recipe?"
body="The current cycle will stop."
primaryButton={{
text: "Change",
onClick: () => {
if (pendingRecipe !== null) setRecipe(pendingRecipe)
setPendingRecipe(null)
},
}}
secondaryButton={{ text: "Cancel", onClick: () => setPendingRecipe(null) }}
/>
</>
)
}Storybook
The Storybook is the visual reference: it renders every component in each of its variants and sizes, with interactive controls, plus design guidelines for color, typography and HMIs.
https://assets.vention.com/machine-ui-storybook/
📋 Versioning Policy
Starting with version 1.0.0, Machine UI follows strict semantic versioning:
- Major versions (e.g., 1.x.x → 2.x.x): Breaking changes to component contracts, APIs, or behavior
- Minor versions (e.g., 1.1.x → 1.2.x): New features with backward compatibility
- Patch versions (e.g., 1.1.1 → 1.1.2): Bug fixes and internal improvements
Any breaking change, no matter how small, will require a major version bump. This ensures you can confidently upgrade patch and minor versions without unexpected breaking changes.
🏭 Building HMIs
Machine UI components work exceptionally well for industrial HMI applications. For guidelines on building touch-screen interfaces optimized for industrial environments, see our documentation on:
- Touch target sizing and spacing
- Readability at distance
- Color contrast requirements
- Simplified interactions for gloved operation
🛠️ Tech Stack
- React: UI framework
- TypeScript: Type safety
- Material-UI (MUI v5): Base component library
- TSS: Styling solution
📄 License
This library is provided for use with Vention machines and applications.
