npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@blackpixel/framer-navbarcomponent

v1.0.0

Published

Generate an iOS-style navigation bar with title, action buttons and search bar.

Downloads

6

Readme

NavbarComponent Framer Module

license PRs Welcome Maintenance

The NavbarComponent module allows you to generate an iOS-style navigation bar with title, action buttons, and search bar. Scroll effects mimic those on iOS, and views can be navigated forward and reverse.

Installation

Manual installation

Copy or save the NavbarComponent file into your project's modules folder.

Adding It to Your Project

In your Framer project, add the following:

myNavbar = require "NavbarComponent"

API

new NavbarComponent

Instantiates a new instance of NavbarComponent.

Available options

myNavbar = new NavbarComponent
		# General
		style: <string> ("light" || "dark")
		size: <string> ("large" || "small")
		title: <string>
		
		# Buttons
		buttonCount: <number>
		buttonSize: <number>
		buttonActions: <array of actions>
		imagePrefix: <string>
		imageSuffix: <string>
		backAction: <action>
		
		# Search bar
		searchLabel: <string>
		search: <boolean>
		dictation: <boolean>
		
		# Colors
		textColor: <string> (hex or rgba)
		backgroundColor: <string> (hex or rgba)
		searchBarColor: <string> (hex or rgba)
		searchIconColor: <string> (hex or rgba)
		accentColor: <string> (hex or rgba)

Activating scroll effects

NavbarComponent will need to know which layer's scroll position it ought to match. Do not attempt to set it as the header of a FlowComponent. Rather, use the scrollWith() feature and indicate your FlowComponent or ScrollComponent to the NavbarComponent.

myNavbar.scrollWith(layer) # layer will be the name of your FlowComponent or ScrollComponent

Navigation effects

To mimic view-by-view navigation, use showNext() and showPrevious(). When using showNext(), provide a title for the next view. NavbarComponent will store these for purposes of returning to them with showPrevious().

myNavbar.showNext("Your title here")
myNavbar.showPrevious()

For debugging help, you can inspect NavbarComponent's stored list of titles.

print myNavbar.history

Navbar size

Not all iOS navbars use the large title style. You may enforce a smaller title using size: "small".

The search bar

If you instantiate the NavbarComponent with search: true, your initial navbar view will display a search bar. Your users can type in this bar. If you wish to check the current value of the search bar, use the search variable.

print myNavbar.search

Button images

All images are assumed to live in the images directory and to be numbered starting with zero. You may supply a prefix and suffix. If your button images are located in a buttons directory within images and named:

item0.png
item1.png
item2.png

then your imagePrefix will be "buttons/item" and your imageSuffix will be "png".

Do not include the images directory in imagePrefix.

Button size

Action button assets are assumed to be 24pt by 24pt. If yours are of another size, supply the correct dimension with buttonSize: <number>. This will prevent your assets from being scaled.

Button actions

The back button that appears on secondary views can be given an action, as can individual action buttons. Most likely, you will want the back button to activate the NavbarComponent's showPrevious() feature, along with any navigation relevant to your prototype (e.g., the showPrevious() FlowComponent feature). Action button actions should be arranged in a comma-separated array, one action per line.

backAction: -> myNavbar.showPrevious()
buttonActions: [
	-> print "1",
	-> print "second",
	-> print "item the third"
]

Website: blackpixel.com  ·  GitHub: @bpxl-labs  ·  Twitter: @blackpixel  ·  Medium: @bpxl-craft