Comments (1)
@kevinduffey Let me just take a quick second to thank you for taking the time to write this feedback, seriously 🙏. I built Modali to make developer's lives easier when implementing modals, and it's feedback like this that will help me reach that goal.
Now that's out of the way, let's discuss your feedback.
I really like the idea of being able to customize the modal easily, probably through the options. As you said, the three areas are:
- Title
- Body
- Footer (namely, buttons)
I've been thinking about this a lot, and the best way to illustrate what's in my head is to give you a code snippet of where I think I want to go when providing an interface for customizing Modali.
Take the hypothetical example below of a modal confirmation when deleting a user:
import Modali, { useModali } from 'modali';
const [exampleModal, toggleExampleModal] = useModali({
title: 'Delete User',
message: 'Are you sure you want to delete this user?',
buttons: [
<ModaliButton
label="Delete"
isStyleDestructive
onClick={handleDeleteUser}
/>,
<ModaliButton
label="Cancel"
isStyleCancel
onClick={toggleExampleModal}
/>
],
animated: true,
});
<Modali.Button />
would be a React button component that Modali provides out of the box, with its own styles (e.g. isStyleCancel, isStyleDestructive, etc).
I'd like to tackle customization in two waves:
- Providing the core components and options to create a functioning, beautiful modal.
- Providing the ability to customize these components by passing styles in to the Modali components.
I'm really interested to hear your thoughts (and anyone else who may be listening!).
from modali.
Related Issues (20)
- Controlling position HOT 2
- Custom "show" effect transition HOT 1
- Add a link to repo from the demo page HOT 2
- Add slight padding to modal on mobile HOT 1
- Content is shifting to left on mobile devices HOT 3
- Add to awesome-react-hooks HOT 1
- Why useRef is used? HOT 4
- separate display from logic HOT 1
- Modali uses shortid & nanoid at the same time HOT 2
- Modals flashing on unmount even with toggle set to false
- react-syntax-highlighter HOT 2
- Dimiss Animation
- Cant scroll HOT 1
- It would be great to pass in ID's as props for the cancel/confirm buttons
- Dist-JS requiring removed CSS-file
- Any way to check if the modal is currently opened ?
- Any features for Focus Trap?
- When { centered: true } onOverlayClicked function is not wroking. HOT 2
- Title is not visible if you set closeButton to false
- Incompatible with `Next.js`. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modali.