Using modal keymaps with add ons

Is there someone who can explain how to use a modal keymap along with an add-on? I’ve figured out how to add a regular keymap that shows up in the user input preferences, but the documentation is lacking on how to add use a modal keymap that works with your own addon. Thanks!