Creating a button in Webflow that has a white stroke and fills left to right with color upon hover involves using interactions and transition easing. Here's how you can set it up:
1. Create the Button
- Add a Button: Drag a button element onto your Webflow canvas.
- Style the Button: Set the button's default background color to transparent and add a white border. Ensure you set the appropriate border width.
2. Set Up the Hover Overlay
- Add a Div Block: Nest a div block inside the button. This will serve as the overlay that fills with color.
- Style the Div Block:
- Set its position to absolute and width to 0%.
- Set the height to 100% and align it to the left.
- Choose a background color for the filling effect (e.g., blue).
3. Add Interactions
- Select the Button: Go to the Interactions panel.
- Create a New Interaction: Choose Mouse Hover as the trigger.
- On Hover In:
- Select the Overlay Div Block.
- Use the Size Action to change the width from 0% to 100%.
- Apply a smooth easing function to achieve a nice transition effect.
- On Hover Out:
- Reverse the Size Action by setting the width back to 0%.
4. Set Transition Easing
- Tweak Easing Settings: In the Size Action settings for both hover in and out, select an appropriate easing option like Ease, Ease-in-out, or Custom for a smoother transition.
5. Final Adjustments
- Test: Preview the interaction to ensure it works smoothly.
- Adjust: Modify the duration and easing as necessary to fine-tune the hover effect.
Summary
To create a Webflow button that features a white stroke and fills with color on hover, set up a div block overlay and use interactions with transition easing to animate the fill effect smoothly from left to right. Adjust the interaction settings to achieve the desired effect.