All Projects → iSapozhnik → Menu

iSapozhnik / Menu

Licence: MIT license
The most customizable menu for macOS apps.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Menu

Dropdownmenukit
UIKit drop down menu, simple yet flexible and written in Swift
Stars: ✭ 246 (+192.86%)
Mutual labels:  popup, dropdown, menu
Tippyjs
Tooltip, popover, dropdown, and menu library
Stars: ✭ 9,433 (+11129.76%)
Mutual labels:  popup, dropdown, menu
React Layer Stack
Layering system for React. Useful for popover/modals/tooltip/dnd application
Stars: ✭ 152 (+80.95%)
Mutual labels:  popup, dropdown
Material Ui Popup State
boilerplate for common Material-UI Menu, Popover and Popper use cases
Stars: ✭ 186 (+121.43%)
Mutual labels:  popup, menu
Semantic Ui
Semantic is a UI component framework based around useful principles from natural language.
Stars: ✭ 49,729 (+59101.19%)
Mutual labels:  popup, dropdown
Fwpopupviewoc
信手拈来的OC弹窗库:1、继承 FWPopupBaseView 即可轻松实现各种位置、动画类型的弹窗;2、新功能引导弹窗。更多弹窗场景等你来挑战,总之,想怎么弹就怎么弹!!!
Stars: ✭ 70 (-16.67%)
Mutual labels:  popup, menu
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (+19.05%)
Mutual labels:  popup, menu
Accordion
Silky-smooth accordion widgets with no external dependencies.
Stars: ✭ 32 (-61.9%)
Mutual labels:  dropdown, menu
Ybpopupmenu
快速集成popupMenu
Stars: ✭ 816 (+871.43%)
Mutual labels:  popup, menu
react-layer-stack
Layering system for React. Useful for popover/modals/tooltip/dnd application
Stars: ✭ 158 (+88.1%)
Mutual labels:  popup, dropdown
Nocturnal
A Dimness and Night Shift menu bar app for macOS 🌙
Stars: ✭ 199 (+136.9%)
Mutual labels:  mac, menu
clicky-menus
Simple click-triggered navigation submenus. Accessible and progressively enhanced.
Stars: ✭ 76 (-9.52%)
Mutual labels:  dropdown, menu
Electron Tray Window
🖼️ Generates custom tray windows with Electron.js
Stars: ✭ 71 (-15.48%)
Mutual labels:  popup, menu
Cascade
Nested popup menus with smooth height animations
Stars: ✭ 1,493 (+1677.38%)
Mutual labels:  popup, menu
Fepopupmenucontroller
A simple, elegant pop-up menu view
Stars: ✭ 32 (-61.9%)
Mutual labels:  popup, menu
ContextMenuSwift
A better version of iOS 13 Context Menu
Stars: ✭ 162 (+92.86%)
Mutual labels:  dropdown, menu
Fwpopupview
弹窗控件:支持AlertView、Sheet、自定义视图的PopupView。AlertView中可以嵌套自定义视图,各组件的显示隐藏可配置;Sheet仿微信样式;同时提供自定义弹出。更多配置请参考”可设置参数“,提供OC使用Demo。
Stars: ✭ 361 (+329.76%)
Mutual labels:  popup, menu
Anylayer
Android稳定高效的浮层创建管理框架
Stars: ✭ 745 (+786.9%)
Mutual labels:  popup, menu
Chinese Lunar Calendar For Mac
Chinese Lunar Calendar for Mac
Stars: ✭ 150 (+78.57%)
Mutual labels:  mac, menu
nativescript-menu
A plugin that adds a pop-up menu to NativeScript
Stars: ✭ 17 (-79.76%)
Mutual labels:  popup, menu

Menu

Swift macOS License: MIT

Fully customizable macOS drop-down menu. It includes 30 settings you can play with.

Requirements

  • Xcode 11+
  • macOS 10.12+
  • Swift 5.0 and higher

Installation

Since this is a Swift Package, the installation process is pretty stright forward.

Manual way

Update your Package.swift dependencies:

dependencies: [
    .package(url: "https://github.com/iSapozhnik/Menu", from: "1.10.1")
]

Via Xcode:

  1. Go to File -> Swift Packages -> Add Package Dependency.
  2. Put GitHub URL https://github.com/iSapozhnik/Menu and click Next
  3. Select the latest version
  4. Click Finish

What can be customized? Everything!

public protocol Configuration {
    var titleBottomSpace: CGFloat                           { get }
    var titleFont: NSFont?                                  { get }
    var titleColor: NSColor                                 { get }
    var backgroundColor: NSColor                            { get }
    var cornerRadius: CGFloat                               { get }
    var hasShadow: Bool                                     { get }
    var appearsBelowSender: Bool                            { get }
    var presentingOffset: CGFloat                           { get }
    var animationDuration: TimeInterval                     { get }
    var contentEdgeInsets: NSEdgeInsets                     { get }
    var maximumContentHeight: CGFloat?                      { get }
    var separatorColor: NSColor                             { get }
    var separatorThickness: CGFloat                         { get }
    var separatorHorizontalPadding: Padding.Horizontal      { get }
    var separatorVerticlaPadding: Padding.Vertical          { get }
    var rememberSelection: Bool                             { get }
    var textAlignment: Alignment                            { get }
    var iconAlignment: Alignment                            { get }
    var menuItemFont: NSFont?                               { get }
    var menuItemHeight: CGFloat                             { get }
    var menuItemHoverBackgroundColor: NSColor               { get }
    var menuItemTextColor: NSColor                          { get }
    var menuItemHoverTextColor: NSColor                     { get }
    var menuItemCheckmarkColor: NSColor                     { get }
    var menuItemHoverCheckmarkColor: NSColor                { get }
    var menuItemCheckmarkHeight: CGFloat                    { get }
    var menuItemCheckmarkThikness: CGFloat                  { get }
    var menuItemHorizontalSpacing: CGFloat                  { get }
    var menuItemImageHeight: CGFloat?                       { get }
    var menuItemImageTintColor: NSColor?                    { get }
    var menuItemHoverImageTintColor: NSColor?               { get }
    var menuItemHoverAnimationDuration: TimeInterval        { get }
}

How to use

import Cocoa
import Menu

class ViewController: NSViewController {
    private let myMenu = Menu(with: "Select a search engine:")

    @IBOutlet var showMenuButton: NSButton!

    override func viewDidLoad() {
        super.viewDidLoad()

        let bing = MenuItem("Bing search", image: Icn.bing.image, action: { [weak self] in
            self?.showMenuButton.title = "Bing"
        })
        let item = MenuItem("DuckDuckGo search", image: Icn.duck.image, action: { [weak self] in
            self?.showMenuButton.title = "DuckDuckGo"
        })
        let google = MenuItem("Google search", image: Icn.google.image, action: { [weak self] in
            self?.showMenuButton.title = "Google"
        })
        let longText = MenuItem("Some very-very-very long text with no icon", action: { [weak self] in
            self?.showMenuButton.title = "Some very long text"
        })
        let emojiItem = MenuItem("Emojis are here 😎🚀", action: { [weak self] in
            self?.showMenuButton.title = "Emojis are here 😎🚀"
        })
        let exit = MenuItem("Exit", image: Icn.exit.image, action: {
            NSApplication.shared.terminate(nil)
        })
        let separator = MenuItem.separator()
        let menuItems = [
            bing,
            item,
            google,
            separator,
            longText,
            emojiItem,
            separator,
            exit
        ]

        myMenu.addItems(menuItems)
    }

    @IBAction func didClickButton(_ sender: NSButton) {
        myMenu.show(from: sender)
    }
}

Examples

In this section I've collected some examples of what can be i,plemented do using Menu control. On the left side some random example from Dribbble and on the right side my implementation.

Dribbble Menu Code
link
link
code

Credits

Created and maintained by @iSapozhnik.

License

Released under the MIT License. See LICENSE for details.

Copyright © 2020-present Sapozhnik Ivan.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].