React Suite is a useful UI library that lets us add many components easily into our React app.
In this article, we’ll look at how to use it to add components to our React app.
We can add a select dropdown with the Dropdown
component.
For instance, we can write:
import React from "react";
import { Dropdown } from "rsuite";
import "rsuite/dist/styles/rsuite-default.css";
export default function App() {
return (
<div className="App">
<Dropdown title="Fruit">
<Dropdown.Item>Apple</Dropdown.Item>
<Dropdown.Item>Orange</Dropdown.Item>
<Dropdown.Item>Grape</Dropdown.Item>
</Dropdown>
</div>
);
}
The title
prop has the placeholder.
Dropdown.Item
has the dropdown items.
We can change how a dropdown is opened.
#web-development #programming #javascript #technology